import { Component, PropsWithChildren } from 'react'
import { Provider } from 'react-redux'
import dva from './dva'
import models from './models'
import './app.scss'

const dvaApp = dva.createApp({
  models
})
const store = dvaApp.getStore()

class App extends Component<PropsWithChildren> {
  state: Readonly<{}> = {
    loading: false
  }

  componentDidMount() {}

  componentDidShow() {}

  componentDidHide() {}

  // this.props.children 是将要会渲染的页面
  render() {
    return (
      <Provider key="store" store={store}>
        {this.props.children}
      </Provider>
    )
  }
}

export default App
